<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>事件处理</title>
    <script src="./vue.js"></script>
</head>
<body>

<div id="app">
    <p>{{message}}</p>
    <button v-on:click="_reverse()">反转字符串</button>
    <!--事件简写方式-->
    <button @click="_reverse()">反转字符串</button>
</div>

<script>
    let vm = new Vue({
        el: '#app',
        data: {
            message: 'hello world'
        },
        methods: {
            _reverse: function () {
                // message进行反转
                this.message = this.message.split("").reverse().join("")
            }
        }
    })
</script>

</body>
</html>